package com.ruoyi.project.integral.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.integral.mapper.IntegralGoodsMapper;
import com.ruoyi.project.integral.domain.IntegralGoods;
import com.ruoyi.project.integral.service.IIntegralGoodsService;

/**
 * 积分商品Service业务层处理
 * 
 * @author wyh
 * @date 2024-08-09
 */
@Service
public class IntegralGoodsServiceImpl implements IIntegralGoodsService 
{
    @Autowired
    private IntegralGoodsMapper integralGoodsMapper;

    /**
     * 查询积分商品
     * 
     * @param id 积分商品主键
     * @return 积分商品
     */
    @Override
    public IntegralGoods selectIntegralGoodsById(Long id)
    {
        return integralGoodsMapper.selectIntegralGoodsById(id);
    }

    /**
     * 查询积分商品列表
     * 
     * @param integralGoods 积分商品
     * @return 积分商品
     */
    @Override
    public List<IntegralGoods> selectIntegralGoodsList(IntegralGoods integralGoods)
    {
        return integralGoodsMapper.selectIntegralGoodsList(integralGoods);
    }

    /**
     * 新增积分商品
     * 
     * @param integralGoods 积分商品
     * @return 结果
     */
    @Override
    public int insertIntegralGoods(IntegralGoods integralGoods)
    {
        integralGoods.setCreateTime(DateUtils.getNowDate());
        return integralGoodsMapper.insertIntegralGoods(integralGoods);
    }

    /**
     * 修改积分商品
     * 
     * @param integralGoods 积分商品
     * @return 结果
     */
    @Override
    public int updateIntegralGoods(IntegralGoods integralGoods)
    {
        integralGoods.setUpdateTime(DateUtils.getNowDate());
        return integralGoodsMapper.updateIntegralGoods(integralGoods);
    }

    /**
     * 批量删除积分商品
     * 
     * @param ids 需要删除的积分商品主键
     * @return 结果
     */
    @Override
    public int deleteIntegralGoodsByIds(Long[] ids)
    {
        return integralGoodsMapper.deleteIntegralGoodsByIds(ids);
    }

    /**
     * 删除积分商品信息
     * 
     * @param id 积分商品主键
     * @return 结果
     */
    @Override
    public int deleteIntegralGoodsById(Long id)
    {
        return integralGoodsMapper.deleteIntegralGoodsById(id);
    }
}
